<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="ALORK 20150428.01" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" />
<meta name="Description" content="<?php echo $this->_var['description']; ?>" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

<title><?php echo $this->_var['page_title']; ?></title>

<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<link rel="stylesheet" href="./public/my_style.css" />
<script type="text/javascript" src="./../js/mobile-common.js"></script>
<?php echo $this->smarty_insert_scripts(array('files'=>'./../js/utils.js,./../js/user.js,./../js/jquery.js,./../js/jquery.json-1.3.js,./../js/region.js,./../js/shopping_flow.js,./../js/transport.js')); ?>
</head>
<body>
      <?php echo $this->fetch('library/user_head.lbi'); ?>
      
      <?php if ($this->_var['action'] == 'address_select'): ?>
      <div id="address_list">
        <?php if ($this->_var['consignee_list']): ?>
        <?php $_from = $this->_var['consignee_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'consignee_0_24587900_1443421827');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['consignee_0_24587900_1443421827']):
?>
        <div class="address_msg" id="d_<?php echo $this->_var['consignee_0_24587900_1443421827']['address_id']; ?>">
          <table class="left<?php if ($this->_var['info']['address_id'] == $this->_var['consignee_0_24587900_1443421827']['address_id']): ?> c_000 <?php endif; ?>" >
            <tr>
              <td><?php echo $this->_var['consignee_0_24587900_1443421827']['region']; ?></td>
            </tr>
            <tr>
              <td><?php echo $this->_var['consignee_0_24587900_1443421827']['address']; ?></td>
            </tr>
            <tr>
              <td><?php echo $this->_var['consignee_0_24587900_1443421827']['consignee']; ?></td>
            </tr>
            <tr>
              <td><?php echo $this->_var['consignee_0_24587900_1443421827']['mobile']; ?></td>
            </tr>
          </table>
          <div class="right" <?php if ($this->_var['info']['address_id'] == $this->_var['consignee_0_24587900_1443421827']['address_id']): ?> style="background:none" <?php endif; ?>>
            <?php if ($this->_var['info']['address_id'] == $this->_var['consignee_0_24587900_1443421827']['address_id']): ?> <div class="one  ">送</div> <?php endif; ?>

            <div class="two  none" onclick="set_address(<?php echo $this->_var['consignee_0_24587900_1443421827']['address_id']; ?>,'<?php echo $this->_var['rid']; ?>','<?php echo $this->_var['judge']; ?>')">配送地址</div>
            <div class="kk none"></div>
            <div class="three none"><a href="address.php?act=address_up&address_id=<?php echo $this->_var['consignee_0_24587900_1443421827']['address_id']; ?>&rid=<?php echo $this->_var['rid']; ?>" style="color:#fff;">修改</a>
            </div>
            <div class="four none" onclick="prompt('删除后无法恢复，点击确认删除','address_delete(<?php echo $this->_var['consignee_0_24587900_1443421827']['address_id']; ?>)')" >删除</div>
          </div>
        </div>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        <a class="add_address" href="address.php?act=address_add&rid=<?php echo $this->_var['rid']; ?>"> +添加收货地址</a>
        <?php else: ?>
        <div class="no_address">
          <img src="./Icon/no_address.jpg" alt="" />
          <a href="address.php?act=address_add&rid=<?php echo $this->_var['rid']; ?>" class="continue">添加收货地址</a>
        </div>
        <?php endif; ?>
      </div>
<script type="text/javascript">

  $('.address_msg').click(function(){
      $(this).find('.one').hide();
      $(this).siblings().find('.one').show();
      $(this).siblings().removeClass('c_000').find('.two').addClass('none').siblings('.three').addClass('none').siblings('.four').addClass('none').siblings('.kk').addClass('none');
      $(this).addClass('c_000').find('.two').removeClass('none').siblings('.three').removeClass('none').siblings('.four').removeClass('none').siblings('.kk').removeClass('none');
  })
</script>  
      <?php endif; ?>

  
    
    <?php if ($this->_var['action'] == 'address_up' || $this->_var['action'] == 'address_add'): ?>
    <form action="address.php" method="post" name="theForm" id="theForm" onsubmit="return VerificationAddress(this)">
    <div  id="address_list">
         
        <div class="address">
          <table >
            <tr>
              <td >收货人姓名：</td>
              <td > <input type="text" name="consignee" value="<?php echo htmlspecialchars($this->_var['consignee']['consignee']); ?>"/></td>
            </tr>
            <tr>
              <td>手机号码：</td>
              <td><input type="text" name="mobile" value="<?php echo htmlspecialchars($this->_var['consignee']['mobile']); ?>" /></td>
            </tr>
            <tr>
              <td>所在区域：</td>
              <td > <div id="region" onclick="$('#address_box').show();"><?php if ($this->_var['consignee']['region']): ?><?php echo htmlspecialchars($this->_var['consignee']['region']); ?><?php else: ?>点击选择地区<?php endif; ?></div></td>
            </tr>
            <?php if ($this->_var['daodansong_is']): ?>
            <tr>
              <td>导蛋送服务：</td>
              <td > <div id="daodansong" onclick="$('#daodansong_box').show();"><?php if ($this->_var['consignee']['daodansong']['area_name']): ?><?php echo htmlspecialchars($this->_var['consignee']['daodansong']['area_name']); ?><?php else: ?>点击选择服务区<?php endif; ?></div></td>
            </tr>
            <?php endif; ?>
            <tr>
              <td>详细地址：</td>
              <td><input type="text" name="address" value="<?php echo htmlspecialchars($this->_var['consignee']['address']); ?>"/></td>
            </tr>
          </table>
        </div>
        <div class="button" onclick="$('#theForm').submit();">确认</div>
        <input type="hidden" name="address_id" value="<?php echo $this->_var['consignee']['address_id']; ?>" />
        <input type="hidden" name="act" value="act_edit_address" />
        <input type="hidden" name="rid" value="<?php echo $this->_var['rid']; ?>" />
    </div>


<div id="address_box" class="none">
<div id="region_bg" onclick="$('#address_box').hide();">
</div>

<div class="address_list one">
    <select name="country" id="selCountries_<?php echo $this->_var['sn']; ?>" onchange="region.changed(this, 1, 'selProvinces_<?php echo $this->_var['sn']; ?>')" style="border:1px solid #ccc;display:none;">
        <?php $_from = $this->_var['country_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'country');if (count($_from)):
    foreach ($_from AS $this->_var['country']):
?>
        <option value="<?php echo $this->_var['country']['region_id']; ?>" <?php if ($this->_var['consignee']['country'] == $this->_var['country']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['country']['region_name']; ?></option>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
    <div class="select_text_ui" style="min-width: 2.5em;"><?php if ($this->_var['consignee']['province_name'] && $this->_var['consignee']['address_id']): ?><?php echo $this->_var['consignee']['province_name']; ?><?php else: ?>请选择省<?php endif; ?></div>
    <select name="province" id="selProvinces_<?php echo $this->_var['sn']; ?>" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 2, 'selCities_<?php echo $this->_var['sn']; ?>')" style="width:100%">
        <option value="0" <?php if (! $this->_var['consignee']['address_id']): ?> selected <?php endif; ?>>请选择省</option>
        <?php $_from = $this->_var['province_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'province');if (count($_from)):
    foreach ($_from AS $this->_var['province']):
?>
            <option value="<?php echo $this->_var['province']['region_id']; ?>" <?php if ($this->_var['consignee']['province'] == $this->_var['province']['region_id'] && $this->_var['consignee']['address_id']): ?>selected<?php endif; ?> ><?php echo $this->_var['province']['region_name']; ?></option>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
</div>
<div class="address_list two">
    <div class="select_text_ui" style="min-width: 2.5em;"><?php if ($this->_var['consignee']['city'] && $this->_var['consignee']['address_id']): ?><?php echo $this->_var['consignee']['city_name']; ?><?php else: ?>请选择市<?php endif; ?></div>
    <select name="city" id="selCities_<?php echo $this->_var['sn']; ?>" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 3, 'selDistricts_<?php echo $this->_var['sn']; ?>')" style="border:1px solid #ccc;">
      <option value="0" <?php if (! $this->_var['consignee']['address_id']): ?> selected <?php endif; ?>>请选择市</option>
      <?php $_from = $this->_var['city_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'city');if (count($_from)):
    foreach ($_from AS $this->_var['city']):
?>
      <option value="<?php echo $this->_var['city']['region_id']; ?>" <?php if ($this->_var['consignee']['city'] == $this->_var['city']['region_id'] && $this->_var['consignee']['address_id']): ?>selected<?php endif; ?>><?php echo $this->_var['city']['region_name']; ?></option>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
</div>
<div class="address_list three">
    <div class="select_text_ui" style="min-width: 2.5em;"><?php if ($this->_var['consignee']['district'] && $this->_var['consignee']['address_id']): ?><?php echo $this->_var['consignee']['district_name']; ?><?php else: ?>请选择区<?php endif; ?></div>
    <select name="district" id="selDistricts_<?php echo $this->_var['sn']; ?>" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());$('.daodansong_select').find('option').eq(0).attr('selected',true);$('.daodansong_select').parent().find('.select_text_ui').text('请选择服务区');$('#daodansong').text('请选择服务区');region_submit(this); " style="border:1px solid #ccc;">
        <option value="0"<?php if (! $this->_var['consignee']['address_id']): ?> selected <?php endif; ?>>请选择区</option>
        <?php $_from = $this->_var['district_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'district');if (count($_from)):
    foreach ($_from AS $this->_var['district']):
?>
        <option value="<?php echo $this->_var['district']['region_id']; ?>"<?php if ($this->_var['consignee']['district'] == $this->_var['district']['region_id'] && $this->_var['consignee']['address_id']): ?>selected<?php endif; ?> ><?php echo $this->_var['district']['region_name']; ?></option>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
</div>

<script type="text/javascript">
var process_request = "<?php echo $this->_var['lang']['process_request']; ?>";
</script>
</div>
<div id="daodansong_box" class="none">
<div id="region_bg" onclick="$('#daodansong_box').hide();">
</div>
<div class="address_list three">
    <div class="select_text_ui" style="min-width: 2.5em;"><?php if ($this->_var['consignee']['daodansong']['area_name']): ?><?php echo $this->_var['consignee']['daodansong']['area_name']; ?><?php else: ?>导蛋快递<?php endif; ?></div>
    <select name="daodansong" class="daodansong_select" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());$('#daodansong_box').hide();$('#daodansong').text($(this).find('option:selected').text())" style="border:1px solid #ccc;">
        <option value="0">请选择服务区</option>
        <?php $_from = $this->_var['daodansong_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['item']):
?>
        <option value="<?php echo $this->_var['item']['area_id']; ?>" <?php if ($this->_var['consignee']['daodansong']['area_id'] == $this->_var['item']['area_id']): ?>selected<?php endif; ?>><?php echo $this->_var['item']['area_name']; ?></option>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
</div>
</div>
</form>
    <?php endif; ?>
<div id="footer"><?php echo $this->_var['footer']; ?></div>
</body>
<script type="text/javascript">
<?php $_from = $this->_var['lang']['clips_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</script>
</html>
